#ifndef SERVER_HEADER
#define SERVER_HEADER

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string>
#include <stdlib.h>
#include <unistd.h>
#include <map>

#include "PKG.h"

#define byte unsigned char

class ibeSERVER
{
private:
  PKG *cPKG;
  int sockfd, portno, clientlen, clientsockfd, n;
  
  //mapping from ID to hwID
	std::map<std::string,std::string> hwID;

  int HandleMessage(int clientSock, byte *szMessage);
  
public:
  ibeSERVER(byte *key);
  bool LoadAuthen(const char *fiName);
  int Run(void);
};

#endif
